/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.feiyue.basic.reader.view;

import android.content.Context;
import android.text.TextPaint;
import android.util.Log;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;

public class PageView extends RelativeLayout {
	public static float font = 15.0F;
	public static int lineHeight;
	public static int lines;
	public static int num = 0;
	public static int rows;
	private String mstr = "";
	private RelativeLayout.LayoutParams params;
	private TextView textView;

	static {
		lineHeight = 0;
		lines = 0;
		rows = 0;
	}

	public PageView(Context paramContext) {
		super(paramContext);
		this.textView = new TextView(paramContext);
		this.params = new RelativeLayout.LayoutParams(-1, -1);
		this.textView.setTextSize(font);
		Log.i("aaaaaa", this.textView.getTextScaleX() + "");
		Log.i("cccccc", this.textView.getTextSize() + "");
		addView(this.textView, this.params);
	}

	public void append(String paramString) {
		this.textView.append(paramString);
	}

	public int[] getfontNum() {
		float f = this.textView.getPaint().measureText("Ʒ");
		lines = this.textView.getHeight() / this.textView.getLineHeight();
		rows = (int) (this.textView.getWidth() / f);
		Log.i("lines", lines + "");
		Log.i("rows", rows + "");
		num = lines * rows;
		Log.i("num", num + "");
		Log.i("font", font + "");
		int[] arrayOfInt = new int[2];
		arrayOfInt[0] = lines;
		arrayOfInt[1] = rows;
		return arrayOfInt;
	}

	public int[] setFont(float paramFloat) {
		font = paramFloat;
		this.textView.setTextSize(font);
		float f = this.textView.getPaint().measureText("Ʒ");
		lines = this.textView.getHeight() / this.textView.getLineHeight();
		rows = (int) (this.textView.getWidth() / f);
		Log.i("lines", lines + "");
		Log.i("rows", rows + "");
		num = lines * rows;
		Log.i("num", num + "");
		Log.i("font", font + "");
		int[] arrayOfInt = new int[2];
		arrayOfInt[0] = lines;
		arrayOfInt[1] = rows;
		return arrayOfInt;
	}

	public void setString(String paramString) {
		this.mstr = paramString;
		this.textView.setText(this.mstr);
		float f = this.textView.getPaint().measureText("Ʒ");
		Log.i("lines",
				this.textView.getHeight() / this.textView.getLineHeight() + "");
		Log.i("rows", this.textView.getWidth() / f + "");
		num = this.textView.getHeight() / this.textView.getLineHeight() * rows;
		Log.i("num", num + "");
	}

	public void setTextColor(int paramInt) {
		this.textView.setTextColor(paramInt);
	}
}